<%@ page language="java" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>树形结构</title>
		<link rel="stylesheet" href="js/dtree/dtree.css" type="text/css"></link>
		<script type="text/javascript" src="js/dtree/dtree.js"></script>
				<script type="text/javascript">
				var str = '';
				/*   
			 		tree.add(id,pid,name,url,title,target,icon,iconOpen,open);
				    id        ：节点自身的id
					pid       ：节点的父节点的id
					name      ：节点显示在页面上的名称
					url       ：节点的链接地址
					title     ：鼠标放在节点上所出现的提示信息
					target    ：节点链接所打开的目标frame（如框架目标mainFrame或是_blank,_self之类）
					icon      ：节点关闭时的显示图片的路径
					iconOpen  ：节点打开时的显示图片的路径
					open      ：布尔型，节点是否打开（默认为false）
				*/
				 tree = new dTree('tree');//创建一个对象.
				 tree.add("0","-1","行政管辖信息");//顶部菜单.
				 //=========================================================================
				 tree.add("1","0","一大队","javascript:reMessage('一大队','1','','','')");//一级菜单（大队）
				 tree.add("2","1","一乡","javascript:reMessage('一大队/一乡','1','2','','')");//二级菜单（乡）
				 tree.add("3","2","一村","javascript:reMessage('一大队/一乡/一村','1','2','3','')");//三级菜单（村）
				 tree.add("4","3","一屯","javascript:reMessage('一大队/一乡/一村/一屯','1','2','3','4')");//四级菜单（屯）
				 //=========================================================================
				 tree.add("5","0","二大队","javascript:reMessage('二大队','5','','','')");//一级菜单（大队）
				 tree.add("6","5","一乡","javascript:reMessage('二大队/一乡','5','6','','')");//二级菜单（乡）
				 tree.add("7","5","二乡","javascript:reMessage('二大队/二乡','5','7','','')");//三级菜单（村）
				 tree.add("8","7","一村","javascript:reMessage('二大队/二乡/一村','5','7','8','')");//四级菜单（屯）
				 //=========================================================================
				 document.write(tree);
				 
				 function reMessage(name,id1,id2,id3,id4){
				 	var str=name+'&'+id1+','+id2+','+id3+','+id4
				 	window.returnValue = str;
    				window.close();
				 }
				 
				 function checkboxResult(nodeId){
				 	if(nodeId=='1'){
				 		str += '一大队;';
				 	}else if(nodeId=='2'){
				 		str += '一大队/一乡;';
				 	}else if(nodeId=='3'){
				 		str += '一大队/一乡/一村;';
				 	}else if(nodeId=='4'){
				 		str += '一大队/一乡/一村/一屯;';
				 	}else if(nodeId=='5'){
				 		str += '二大队;';
				 	}else if(nodeId=='6'){
				 		str += '二大队/一乡;';
				 	}else if(nodeId=='7'){
				 		str += '二大队/二乡;';
				 	}else if(nodeId=='8'){
				 		str += '二大队/二乡/一村;';
				 	}
				 }
				 function check(){
				 	window.returnValue = str;
				 	window.close();
				 }
			    </script>
	</head>
	<body>
	<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
	  <tr>
         <td height="30" align="right"><input type="submit" name="button" id="button" onclick="check()" value="确定"></td>
      </tr>
	</table>
	</body>
</html>
